package com.javacoo.event.client.support;

import java.lang.reflect.Method;
import java.util.List;
import java.util.Objects;

import lombok.Builder;
import lombok.Data;

/**
 * 事件元数据
 * <li></li>
 *
 * @author: duanyong@jccfc.com
 * @since: 2021/10/18 11:42
 */
@Data
@Builder
public class EventMetaData {
    /**
     * 目标监听对象名称
     */
    private String beanName;
    /**
     * 目标监听对象class
     */
    private Class targetClass;
    /**
     * 目标方法
     */
    private List<Method> targetMethods;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        EventMetaData that = (EventMetaData) o;
        return Objects.equals(beanName, that.beanName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(beanName);
    }
}
